/**
 * @name: user
 * @data: 2024/6/7 15:25
 */
import projectRequest from "@/api/index";

export interface InsertUserVO {
  /** 生日 */
  birthday?:string,
  /** 封面 */
  cover?:string,
  introduction?:string,
  motto?:string,
  password:string,
  nickname?:string,
  type?:number,
  realname?:string,
  nationalityId?:number,
  nationality?:string,
  otherName?:string
  phone:string
}

/**
 * @description 新增用户
 * @param data
 */
export function insertUserApi(data:InsertUserVO) {
  return projectRequest.request({
    method: "post",
    url: "/user/insert",
    data
  });
}

/**
 * @description 删除用户
 * @param userId 用户id
 */
export function deleteUserApi(userId:number) {
  return projectRequest.request({
    method:"delete",
    url:`/user/${userId}`
  });
}

/**
 * @description 查看用户
 * @param userId
 */
export function selectUserByIdApi(userId:number) {
  return projectRequest.request({
    method:"get",
    url:`/user/${userId}`
  });
}
